package pers.cz.orm.db;

import org.junit.Test;
import pers.cz.common.sharding.ShardingStrategy;
import pers.cz.orm.dao.CommonDbDaoImpl;
import pers.cz.orm.entity.ImsJsonSoap10;

import java.util.Date;

/**
 * @program: Jef-orm
 * @description: 测试修改
 * @author: Cheng Zhi
 * @create: 2023-09-02 16:10
 **/
public class Update {

    /**
     * @author Chengzhi
     * @date 2023-09-02
     * @测试目的： jef-orm方式更新同时自定义分表规则
     * @预期结果:
     */
    @Test
    public void testSingleUpdate(){
        ImsJsonSoap10 imsJsonSoap10 = new ImsJsonSoap10();
        imsJsonSoap10.setJsonId("99999");
        imsJsonSoap10.getShardingRule().addShardingRule(new Date(), ShardingStrategy.YEAR_MONTH);
        imsJsonSoap10.getQuery().addCondition(ImsJsonSoap10.Field.busiCode, 8888);
        new CommonDbDaoImpl().update(imsJsonSoap10);
    }
}
